Upgrade rust/crates/instant to 0.1.10 Test: make Change-Id: I9fea83cf980dd876681e3df3b076e1ffd6aafa96
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json index 0fa03ad..56bc629 100644 --- a/.cargo_vcs_info.json +++ b/.cargo_vcs_info.json
@@ -1,5 +1,5 @@ { "git": { - "sha1": "eff71cffcc21f0b6d84a7dc3009cacb9ff16b4ea" + "sha1": "1f72ffddf0dbc4e6905d8543d113324d6967e038" } }
diff --git a/Android.bp b/Android.bp index 4d1f5e3..c723067 100644 --- a/Android.bp +++ b/Android.bp
@@ -1,4 +1,5 @@ // This file is generated by cargo2android.py --run --device --dependencies. +// Do not modify this file as changes will be overridden on upgrade. package { default_applicable_licenses: ["external_rust_crates_instant_license"],
diff --git a/Cargo.toml b/Cargo.toml index 58dea4e..9e648c8 100644 --- a/Cargo.toml +++ b/Cargo.toml
@@ -13,7 +13,7 @@ [package] edition = "2018" name = "instant" -version = "0.1.9" +version = "0.1.10" authors = ["sebcrozet <developer@crozet.re>"] description = "A partial replacement for std::time::Instant that works on WASM too." readme = "README.md"
diff --git a/Cargo.toml.orig b/Cargo.toml.orig index f6be57f..7cd1dc4 100644 --- a/Cargo.toml.orig +++ b/Cargo.toml.orig
@@ -1,6 +1,6 @@ [package] name = "instant" -version = "0.1.9" +version = "0.1.10" authors = ["sebcrozet <developer@crozet.re>"] description = "A partial replacement for std::time::Instant that works on WASM too." repository = "https://github.com/sebcrozet/instant"
diff --git a/METADATA b/METADATA index c8d8100..c22facd 100644 --- a/METADATA +++ b/METADATA
@@ -7,13 +7,13 @@ } url { type: ARCHIVE - value: "https://static.crates.io/crates/instant/instant-0.1.9.crate" + value: "https://static.crates.io/crates/instant/instant-0.1.10.crate" } - version: "0.1.9" + version: "0.1.10" license_type: NOTICE last_upgrade_date { - year: 2020 - month: 11 - day: 19 + year: 2021 + month: 8 + day: 9 } }
diff --git a/src/wasm.rs b/src/wasm.rs index 986bbf6..57ea39c 100644 --- a/src/wasm.rs +++ b/src/wasm.rs
@@ -128,11 +128,17 @@ #[cfg(not(any(feature = "wasm-bindgen", feature = "stdweb")))] mod js { extern "C" { + #[cfg(not(target_os = "emscripten"))] pub fn now() -> f64; + #[cfg(target_os = "emscripten")] + pub fn _emscripten_get_now() -> f64; } } // Make the unsafe extern function "safe" so it can be called like the other 'now' functions #[cfg(not(any(feature = "wasm-bindgen", feature = "stdweb")))] pub fn now() -> f64 { - unsafe { js::now() } + #[cfg(not(target_os = "emscripten"))] + return unsafe { js::now() }; + #[cfg(target_os = "emscripten")] + return unsafe { js::_emscripten_get_now() }; }